<div class="divmain">
<table width="100%" id="fmfrmreportcurrent_tblinfo" class="tblInfo">
<tr> 
<td width="25%">
<div class="divLeft">  
<table class="info" id="fmfrmreportcurrent_tblcondition">
<tr >
<td  class="width100 clssearch" id="fmfrmreportcurrent_tdcondsearch">
<table class="width100">

<tr style="border-bottom:thin solid #000000;"><td width="40%" style="text-align:right;border-bottom:thin solid #000000;">Gửi sms doanh thu:</td><td style="text-align:right;border-bottom:thin solid #000000;" >
 <button id="fmfrmreportcurrent_smsSend" class="smsSend width100" onclick="fmfrmreportcurrent_smsSend();" type="button"> Gửi </button>
</td></tr>

<tr><td width="40%">Tiền sản phẩm:</td><td id="fmfrmreportcurrent_doanhthu" ></td></tr>
<tr><td>Khoản thu khác:</td><td id="fmfrmreportcurrent_moneyget" class="cls_summary" ></td></tr>
<tr><td>Khoản chi:</td><td id="fmfrmreportcurrent_moneypay" class="cls_summary" ></td></tr>
<tr><td>Doanh thu:</td><td id="fmfrmreportcurrent_revenue" class="cls_summary" ></td></tr> 
<tr><td width="40%">Mã hóa đơn:</td><td style="text-align:right">
<input maxlength="9" type="text" id="fmfrmreportcurrent_txtmhd" class="isNumber width100" /></td></tr>

  
</table>
    <div class="divactionbuton">
    <button id="fmfrmreportcurrent_create" class="bntreport" onclick="fmfrmreportcurrent_createReport();" type="button"> Xem </button>
    </div>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>   
</div>
</td> 
<td class="clsmiddle"></td> 
<td width="75%" height="400" valign="top">
<div class="divGrid" id="fmfrmreportcurrent_divGrid">

</div>
<div  id="fmfrmreportcurrent_divprint"  style="width:400px" align="center">
</div>
<div  id="fmfrmreportcurrent_divsms"  style="width:400px" align="center">
<table class="width100">
<tr>
<td style="text-align:right">(Các) số điện thoại :
</td>
<td><input id="fmfrmreportcurrent_txtphonenumber" type="text" maxlength="50" class="width100"/>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center">NỘI DUNG TIN NHẮN
</td>
</tr>
<tr>
<td style="text-align:right">Tiền sản phẩm:
</td>
<td id="fmfrmreportcurrent_doanhthusms">
</td>
</tr>
 <tr><td style="text-align:right">Khoản thu khác:</td><td id="fmfrmreportcurrent_moneygetsms" class="cls_summary" ></td></tr>
<tr><td style="text-align:right">Khoản chi:</td><td id="fmfrmreportcurrent_moneypaysms" class="cls_summary" ></td></tr>
<tr><td style="text-align:right">Doanh thu:</td><td id="fmfrmreportcurrent_revenuesms" class="cls_summary" ></td></tr> 

<tr>
<td style="text-align:right">Tính đến:
</td>
<td id="fmfrmreportcurrent_timesms">
</td>
</tr>
<tr>
<td style="text-align:right">Ngày :
</td>
<td id="fmfrmreportcurrent_datesms">
</td>
</tr>
<tr>
<td rowspan="4" style="color:blue;text-align:right">  Chú ý:   
</td>
<td style="color:blue">
- Có thể nhắn tin nhiều số điện thoại cùng lúc.
</td>
</tr>
<tr>
<td style="color:blue">
- Các số điện thoại phải cách nhau dấu ';' . 
</td>
</tr>
<tr>
<td style="color:blue">
- Tính từ 00:00:00 ngày hiện tại đến thời điểm bấm nút [Xem] 
</td>
</tr>
<tr>
<td style="color:blue">
- Phí dịch vụ mỗi tin nhắn là 1000 vnđ/1 số điện thoại 
</td>
</tr>
<tr>
<td colspan="2">  <button id="fmfrmreportcurrent_confirm" class="bntreport" onclick="fmfrmreportcurrent_confirm();" type="button"> Xác nhận </button> 
 <button id="fmfrmreportcurrent_confirm" class="cancelDialog" type="button"> Bỏ qua </button>  
</td>
</tr>

</table>
</div>
</td>
<td class="clsend"></td>
</tr>
</table>
</div>

 <script language="javascript">
 var fmfrmreportcurrent_smscontent = '' ;
// var fmfrmreportcurrent_smsnumber ='';
 changeWaiting(0);
 $(document).ready(function () {
    initForm('fmfrmreportcurrent_tblinfo'); 
    initDivleft();
    
    $('#fmfrmreportcurrent_divprint').dialog({
        autoOpen: false,
        modal:true,
        width: 400,
        resizable: true,
        overflow: 'auto'
    });    
    $('#fmfrmreportcurrent_divsms').dialog({
        autoOpen: false,
        title: 'Gửi thông tin doanh thu',
        modal:true,
        width: 600,
        resizable: true,
        overflow: 'auto'
    });
    
        $('.fm_btnprint_view').live('click', function(){

        var strPrint = '<tr style="font-size:9px;font-weight:bold"><td>Sản Phẩm</td><td>SL</td><td>T.tiền</td></tr>';

        $('#fmfrmreportcurrentfm_tblBill').find('tr').each(function(){
            strPrint += '<tr>';
            if($(this).css('display')!='none'){
                if($(this).hasClass('cls_total')){
                    var flg = 0;
                    $(this).find('td').each(function(){
                        var temp = $(this).html();
                        if(flg==0){
                            strPrint+= '<td align="right" colspan="2" style="font-size:10px;font-weight:bold">'+temp+'</td>';
                            flg=1;
                        }else{
                            strPrint+= '<td align="right" style="font-size:10px;font-weight:bold">'+temp+'</td>';
                        }
                        var temp = $(this).html();
                    });
                }else{
                    $(this).find('td').each(function(){
                        var temp = $(this).html();
                        strPrint+= '<td>'+temp+'</td>';
                    });
                }

            }
            strPrint += '</tr>';


        });
        var fm_greeting_bill=fm_obj.config.fm_greeting_bill;
        if(fm_greeting_bill!=''){
            strPrint+='<tr><td colspan="3"><hr/></td></tr>';
            strPrint+='<tr><td colspan="3">'+fm_greeting_bill+'</td></tr>';
        }

        $('#fm_tableprint').html(strPrint);
        $('#fmfrmreportcurrent_divprint').dialog('close');  
        $( ".fm_printable" ).print(); 


    });
});


function fmfrmreportcurrent_createReport(){
 changeWaiting(0);
 var mhd = $('#fmfrmreportcurrent_txtmhd').val();
 xajax_fmfrmreportcurrent_load(mhd); 
}

function fmfrmreportcurrent_smsSend(){
    if(checkStatusSMS()){     
       $('#fmfrmreportcurrent_divsms').dialog('open');  
    }
}

function fmfrmreportcurrent_confirm(){ 

   var $phonenumber = $('#fmfrmreportcurrent_txtphonenumber').val(); 
   if(!checkListPhone($phonenumber,true)){
      $('#fmfrmreportcurrent_txtphonenumber').focus();
          return; 
   }   
   xajax_fmfrmreportcurrent_saveSMS($phonenumber,fmfrmreportcurrent_smscontent);   
}

//ExpInteger.test(e)

changeWaiting(0);
fmfrmreportcurrent_createReport();
xajax_fmfrmreportcurrent_setPhonenumber();


 </script>

